package cn.bdqn.configclient;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.security.auth.login.Configuration;

@SpringBootApplication
@EnableEurekaClient
@RestController
@RefreshScope
public class ConfigClient {

    public static void main(String[] args) {
        SpringApplication.run(ConfigClient.class);
    }

    @Value("${foo}")
    String foo;

    @GetMapping("/foo")
    public String getFoos(){
        return foo;
    }
}
